<template>
  <!-- 此组件仅用于展示和切换验证码图片 -->
  <div
  v-html="base64stringC"
  @click="getNewCaptcha"
  class="captcha"
  title="点击切换验证码"></div>
</template>
<script>
  export default {
    name: 'captcha',
    data() {
      return {
        base64stringC: '<img style="width: 100px;height: 54px" src="https://storage.deepin.org/forum/2021040112064204_1617206802.jpg">',
        idKeyC:""
      }
    },
    methods: {
      // 获取验证码
      getNewCaptcha() {
        this.$axios.login.getCaptcha().then(res => {
          this.base64stringC = '<img style="width: 100px;height: 54px" src="'+res.data.data.base64stringC+'">'
          this.idKeyC = res.data.data.idKeyC
        })
      }
    },
    created() {
      this.getNewCaptcha()
    }
  }
</script>

<style lang="scss" scoped>
  .captcha{
    cursor: pointer;
  }
</style>
